#!/usr/bin/env python
# -*- coding:utf-8 -*-

# Copyright 2025 IDDM Authors

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
    @Date   : 2025/8/21 16:08
    @Author : chairc
    @Site   : https://github.com/chairc
"""
from unittest import TestCase

from iddm.utils import network_initializer


class Test(TestCase):
    def test_network_initializer(self):
        """
        Test network initializer
        This test checks if the network initializer can be imported without errors.
        """
        try:
            network = "unet-flash-self-attn"
            device = "cpu"
            network_model = network_initializer(network=network, device=device)
        except Exception as e:
            self.fail(f"Network initializer failed with error: {e}")
        self.assertIsNotNone(network_model, "Network model should not be None")
        self.assertTrue(hasattr(network_model, "forward"), "Network model should have a forward method")
